﻿#include "FITKSurfaceMeshingParameter.h"

namespace Interface
{
    void FITKSurfaceMeshingParameter::initElementDefault()
    {
        _geometricOrder = GeometricOrder::Linear;
    }

    void FITKSurfaceMeshingParameter::initControlDefault()
    {
        _eleType = ElementType::Triangle;
        _globalMeshSize = 0;
        _maxMeshSize = 0;
        _minMeshSize = 0;
    }

    bool FITKSurfaceMeshingParameter::setAnisotropicMeshing(bool toggle)
    {
        return false;
    }

    bool FITKSurfaceMeshingParameter::getAnisotropicMeshing()
    {
        return false;
    }

    bool FITKSurfaceMeshingParameter::setAnisotropicRatio(double ratio)
    {
        return false;
    }

    double FITKSurfaceMeshingParameter::getAnisotropicRatio()
    {
        return 0.0;
    }

    void FITKSurfaceMeshingParameter::setClosedGeometry(bool toggle)
    {
    }

    bool FITKSurfaceMeshingParameter::getClosedGeometry()
    {
        return false;
    }

    void FITKSurfaceMeshingParameter::setElementOrder(int order)
    {
        _elementOrder = order;
    }

    int FITKSurfaceMeshingParameter::getElementOrder()
    {
        return _elementOrder;
    }

    void FITKSurfaceMeshingParameter::setGlobalMeshSize(double gSize)
    {
        _globalMeshSize = gSize;
    }

    double FITKSurfaceMeshingParameter::getGlobalMeshSize()
    {
        return _globalMeshSize;
    }

    void FITKSurfaceMeshingParameter::setMaxMeshSize(double size)
    {
        _maxMeshSize = size;
    }

    double FITKSurfaceMeshingParameter::getMaxMeshSize()
    {
        return _maxMeshSize;
    }

    void FITKSurfaceMeshingParameter::setMinMeshSize(double size)
    {
        _minMeshSize = size;
    }

    double FITKSurfaceMeshingParameter::getMinMeshSize()
    {
        return _minMeshSize;
    }

    bool FITKSurfaceMeshingParameter::setElementType(ElementType eleType)
    {
        _eleType = eleType;
        QMetaEnum et = QMetaEnum::fromType<ElementType>();
        QString str = et.valueToKey((int)eleType);
        if (str.isEmpty()) return false;
        return true;
    }

    QString FITKSurfaceMeshingParameter::getElementTypeForString()
    {
        QMetaEnum et = QMetaEnum::fromType<ElementType>();
        QString str = et.valueToKey((int)_eleType);
        return str;
    }

    FITKSurfaceMeshingParameter::ElementType FITKSurfaceMeshingParameter::getElementType()
    {
        return _eleType;
    }

    void FITKSurfaceMeshingParameter::setTechnique(TechniqueType tType)
    {
        _techniqueType = tType;
    }

    FITKSurfaceMeshingParameter::TechniqueType FITKSurfaceMeshingParameter::getTechnique()
    {
        return _techniqueType;
    }

    void FITKSurfaceMeshingParameter::setMaxNumberOfThreads(int numberThreads)
    {
        if (numberThreads > 0)  _maxNumberThreads = numberThreads;
    }

    int FITKSurfaceMeshingParameter::getMaxNumberOfThreads()
    {
        return _maxNumberThreads;
    }
}


